package com.mashibing.remote;

import com.mashibing.internalcommon.dto.ResponseResult;
import com.mashibing.internalcommon.response.NumberCodeResponse;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class ServiceVerificationCodeFallBackFactory implements FallbackFactory<ServiceVerificationCodeClient> {
    @Override
    public ServiceVerificationCodeClient create(Throwable cause) {
        return (size,num) -> {
            NumberCodeResponse numberCodeResponse = new NumberCodeResponse();
            numberCodeResponse.setNumberCode(142654 + "");
            return ResponseResult.success(numberCodeResponse);
        };
    }
}
